//
//  LVBaseViewModel.h
//  Base
//
//  Created by 曹连华 on 2019/3/13.
//  Copyright © 2019 曹连华. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface LVBaseViewModel : NSObject

typedef void(^LVCompletionBlock)(NSString  * _Nullable message);

typedef void(^LVReloadActionBlock)(NSIndexSet * _Nullable sections ,NSArray<NSIndexPath*> * _Nullable  indexPaths);

@property (nonatomic, strong, readonly) NSString *requestVCName;

- (instancetype)initWithVC:(UIViewController *)vc;

///在ViewModel 中调用此函数 进行showLoadingBlock 的 调用执行
- (void)showLoading;
- (void)showLoadingWithMessage:(nullable NSString *)message;

///在ViewController 实现 showLoadingBlock 进行loading显示的操作
@property (nonatomic, copy) LVCompletionBlock showLoadingBlock;

///在ViewModel 中调用此函数 进行hideLoadingBlock 的 调用执行
- (void)hideLoading;

///在ViewController 实现 hideLoadingBlock 进行loading隐藏的操作
@property (nonatomic, copy) LVCompletionBlock hideLoadingBlock;

///在ViewModel 中调用此函数 进行makeToastBlock 的 调用执行
- (void)makeToastWithMessage:(nullable NSString *)message;

///在ViewController 实现 makeToastBlock 进行显示toast操作
@property (nonatomic, copy) LVCompletionBlock makeToastBlock;

- (void)initOperateBlock;

///子类重新该方法 初始化 dataSource
- (void)resetDataSource;

/// 在 ViewController 的 didSelectRowAtIndexPath 方法中调用  子类可重写
- (void)didSelectedRowModelWithIndexPath:(NSIndexPath *)indexPath;

@end

NS_ASSUME_NONNULL_END
